#
# COMPARA DATOS DE MOVILIDAD CON LAS MUERTES POR COVID EN LA CIUDAD DE BS AS
#
# 2021-04-19  version actual:   2021-05-04 
# GRUPO:  
#       Cristian Veiga
#       Cristian De Blasis
#       Gabriel Guiño
#       Guillermo Millich
#       Nicolas Gentile
################################################################################

source("check_packages.R")
source("mobility_df.R")
## Warning: package 'tidyr' was built under R version 3.6.3
source("covid_df.R")
source("grafica.R")
## Warning: package 'ggplot2' was built under R version 3.6.3
## Warning: package 'patchwork' was built under R version 3.6.3
## Warning: package 'plotly' was built under R version 3.6.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
check_packages()
## [1] TRUE
city = "Buenos Aires"
trans = "walking"

#Obtiene dataframe de movilidad
movilidad<-get_mobility_df(city,trans)
## https://covid19-static.cdn-apple.com/covid19-mobility-data/2107HotfixDev9/v3/en-us/applemobilitytrends-2021-05-04.csv
#Obtiene dataframe de COVID death
COVID_19<-get_covid_death_per_day()
## Warning: package 'readr' was built under R version 3.6.3
## Warning: package 'dplyr' was built under R version 3.6.3
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
#Unir los dos dataframes, se usa la fecha como Key (tienen el mismo nombre)
final<- merge(movilidad, COVID_19)

#grafica
graficar(final)